package main

import (
    "crypto/hmac"
    "crypto/sha256"
    "encoding/hex"
)

func generateAuthKey(message, key string) string {
    mac := hmac.New(sha256.New, []byte(key))
    mac.Write([]byte(message))
    return hex.EncodeToString(mac.Sum(nil))
}

func verifyAuthKey(message, key, expected string) bool {
    return generateAuthKey(message, key) == expected
}